import request from '@/utils/request'

export function getGoodsInfo(data) {
  return request({
    url: '/backend/goods/list',
    method: 'post',
    data
  })
}

export function addGoods(data) {
  return request({
    url: '/backend/goods/add',
    method: 'post',
    data
  })
}
export function delGoods(data) {
  
  return request({
    url: '/backend/goods/delete',
    method: 'post',
    data
  })
}
//获取分类
export function getCateGory(data) {
  return request({
    url: '/backend/category/list',
    method: 'post',
    data
  })
}

//获取级联分类
export function getCategoryInfo(data) {
  return request({
    url: '/backend/category/level/list',
    method: 'post',
    data
  })
}
//编辑商品

export function editGoods(data) {
  
  return request({
    url: '/backend/goods/update',
    method: 'post',
    data
  })
}

//商品详情
export function getDetail(data) {
  
  return request({
    url: '/backend/goods/detail',
    method: 'post',
    data
  })
}

//添加商品分类
export function addCategory(data) {
  return request({
    url: '/backend/category/add',
    method: 'post',
    data
  })
}

//删除分类
export function delCategory(data) {
  return request({
    url: '/backend/category/delete',
    method: 'post',
    data
  })
}
//获取优惠券列表 page limit
export function getCouponsInfo(data) {
  return request({
    url: '/backend/coupon/list',
    method: 'post',
    data
  })
}

//删除优惠券 id
export function delCouponsInfo(data) {
  return request({
    url: '/backend/coupon/delete',
    method: 'post',
    data
  })
}
//编辑优惠券 
export function editCouponsInfo(data) {
  return request({
    url: '/backend/coupon/update',
    method: 'post',
    data
  })
}
//增加优惠券 
export function addCouponsInfo(data) {
  return request({
    url: '/backend/coupon/add',
    method: 'post',
    data
  })
}
//获取评价列表
export function getCommentInfo(data) {
  return request({
    url: '/backend/comment/list',
    method: 'post',
    data
  })
}

//删除评价
export function delCommentInfo(data) {
  return request({
    url: '/backend/comment/delete',
    method: 'post',
    data
  })
}
